package cn.bj.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import cn.bj.beans.Yxfw_car;
import cn.bj.dao.Yxfw_carMapper;

@Service
public class CarService {

	@Autowired
	Yxfw_carMapper yxfw_carMapper;

	// 查询所有
	public List<Yxfw_car> getAllCandys() {
		return yxfw_carMapper.selectByExample(null);
	}

	// 插入
	public int insrtCar(Yxfw_car car) {
		return yxfw_carMapper.insert(car);
	}

	// 删除
	public int deleteCar(Integer id) {
		return yxfw_carMapper.deleteByPrimaryKey(id);
	}

	// 查询单个
	public Yxfw_car selectById(Integer id) {
		return yxfw_carMapper.selectByPrimaryKey(id);
	}

	// 修改
	public int updateCar(Yxfw_car car) {
		return yxfw_carMapper.updateByPrimaryKey(car);
	}

}
